jQuery('#loginmenu').find('.nologin').eq(0).attr('href','https://bbs.snsnb.com/member.php?mod=logging&action=login&referer='+window.location.href);
jQuery('#loginmenu').find('.nologin').eq(1).attr('href','https://bbs.snsnb.com/member.php?mod=z_reg&action=login&referer='+window.location.href);
jQuery('document').ready(function($) {
  jQuery.ajax({
        url: 'https://bbs.snsnb.com/api/login/box_gm.php',
        cache:false,  
        async:true,  
        dataType : 'jsonp',  
        jsonp:"jsoncallback",
        timeout:1000*10,  
        type:'GET',  
        success: function(data, textStatus){
          if(data.sta==undefined){
            data=eval('('+data+')');
          }
            if(data.sta){
              if (data.bbs_num||data.ask_sys) {
                if ((Number(data.bbs_num)+Number(data.ask_sys))>0) {
                  jQuery('#mess_count').html((Number(data.bbs_num)+Number(data.ask_sys)));
                  jQuery('#mess_count').show();
                };
                jQuery('#loginmenu').find('ul').show();
              }
              if (data.bbs_my_post!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=notice&view=mypost" rel="nofollow">我的帖子('+data.bbs_my_post+')</a>');
              }
              if (data.bbs_friend_mess!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=notice&view=interactive" rel="nofollow">坛友互动('+data.bbs_friend_mess+')</a>');
              }
              if (data.bbs_sys_mess!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=notice&view=system" rel="nofollow">系统提醒('+data.bbs_sys_mess+')</a>');
              }
              if (data.bbs_manage_mess!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=notice&view=manage" rel="nofollow">管理工作('+data.bbs_manage_mess+')</a>');
              }
              if (data.bbs_app_mess!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=notice&view=app" rel="nofollow">应用提醒('+data.bbs_app_mess+')</a>');
              }
              if (data.ask_sys!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="message/system.html">问答提醒('+data.ask_sys+')</a>');
              }
              if (data.bbs_mess!=0) {
                jQuery('#mess_box').append('<a target="_blank" href="https://bbs.snsnb.com/home.php?mod=space&do=pm" rel="nofollow">消息('+data.bbs_mess+')</a>');
              }
              jQuery('#login_box_my_space').attr('href', 'https://bbs.snsnb.com/space-uid-'+data.u_id+'.html');
              jQuery('#loginbox_user_head').attr('href', 'https://bbs.snsnb.com/space-uid-'+data.u_id+'.html');
              jQuery('#loginbox_user_name').attr('href', 'https://bbs.snsnb.com/space-uid-'+data.u_id+'.html');
              jQuery('#loginbox_logout').attr('href', 'https://bbs.snsnb.com/member.php?mod=logging&action=logout&formhash='+data.bbs_hash);
              jQuery('#loginbox_user_name').html(data.u_name);
              jQuery('#loginbox_user_head').html('<img src="'+data.u_head+'">');
              jQuery('.login_p_b_a').show();
              jQuery('#loginmenu').find('.nologin').hide();
            }else{
              jQuery('.login_p_b_a').hide();
              jQuery('#loginmenu').find('.nologin').show();
            }
        },   
        error:function (XMLHttpRequest, textStatus, errorThrown) {  
            // jQuery('#jd').html('更新失败');  
            // clearInterval(interval);  
            // url_index=0;
        }  
    });
});
jQuery(".hovernav").mouseover(function(){
  jQuery(this).children(".hidenav").show();
});
jQuery(".hovernav").mouseout(function(){
  jQuery(this).children(".hidenav").hide();
});